import {lazy}  from "react"
const Index =lazy(()=>import('../views/Index'))
import Login from "../views/Login"



const Console =lazy(()=>import("../views/operate/Console"))
const Goodscount =lazy(()=>import("../views/operate/Goodscount"))
const Trade=lazy(()=>import("../views/operate/trade"))

const Goodsmanger =lazy(()=>import("../views/goods/Goodsmanger"))
const Goodstype =lazy(()=>import("../views/goods/Goodstype"))
const GoodsSpecs =lazy(()=>import("../views/goods/GoodsSpecs"))
const Goodsevaluate =lazy(()=>import("../views/goods/Goodsevaluate"))
const Goodsorder =lazy(()=>import("../views/order/Goodsorder"))
const Usercount=lazy(()=>import("../views/operate/usercount"))

const UserGroups=lazy(()=>import("../views/user/UserGroups"))
const UserManage=lazy(()=>import("../views/user/UserManage"))
const UserLable=lazy(()=>import("../views/user/UserLable"))
const UserRank=lazy(()=>import("../views/user/UserRank"))


const Articletype=lazy(()=>import("../views/content/Articletype"))
const Articlemanger=lazy(()=>import("../views/content/Articlemanger"))
const router= [
    {
        path:"/",
        element:<Index></Index>,
        meta:{
            title:"首页",
        },
        children:[
            {
                // path:"console",
                index:true,
                element:<Console/>,
                meta:{title:"控制台"}
            },
            {
                path:"goodscount",
                element:<Goodscount/>,
                meta:{title:"商品统计"}
            },
            {
                path:"usercount",
                element:<Usercount/>,
                meta:{title:"用户统计"}
            },
            {
                path:"trade",
                element:<Trade/>,
                meat:{title:"交易统计"}
            },
// 下面是商品管理
            {
                path:"goodsmanger",
                element:<Goodsmanger/>,
                meta:{title:"商品管理"}
            },
            {
                path:"goodstype",
                element:<Goodstype/>,
                meta:{title:"商品分类"} 
            },
            {
                path:"goodsspecs",
                element:<GoodsSpecs/>,
                meta:{title:"商品规格"} 
            },
            {
                path:"goodsevaluate",
                element:<Goodsevaluate/>,
                meta:{title:"商品评价"} 
            },
            {
                path:"goodsorder",
                element:<Goodsorder/>,
                meta:{title:"商品订单"}
            },

            




            {
                path:"usermanage",
                element:<UserManage/>,
                meta:{title:"用户管理"}
            },
            {
                path:"userlable",
                element:<UserLable/>,
                meta:{title:"用户标签"}
            },
            {
                path:"userrank",
                element:<UserRank/>,
                meta:{title:"用户等级"}
            },
            {
                path:"usergroups",
                element:<UserGroups/>,
                meta:{title:"用户分组"}
            },




            {
                path:"articletype",
                element:<Articletype/>,
                meta:{title:"文章分类"}
            },
            {
                path:"articlemanger",
                element:<Articlemanger/>,
                meta:{title:"文章管理"}
            }
        ]
    },
    {
        path:"/login",
        element:<Login></Login>,
        meta:{
            title:"登录"
        }
    },
    {
        path:"*",
        element:<h1>NOT FOUND 404</h1>,
        meta:{
            title:"404"
        }
    }
]
export default router